const fetch = require('node-fetch');
const url = require("url");
const querystring = require("querystring");
const {
  redis_client,
  redis_prefix,
  md5,
  db,
  dbPromise,
  fbadmin,
} = require("../unit");
const {
  User
} = require("./admin");

exports.setup = (router) => {
  router.get("/data/results/:room_hash_id", async(ctx, next) => {
    const {room_hash_id} = ctx.params;
    if(!room_hash_id){
      throw "参数错误"
    }
    const room_log = await dbPromise(db.ref("room_logs/"+room_hash_id),{null_errormsg:"找不到指定牌局记录"})
    ctx.body = room_log;
  });
}
